package event_data

import (
	"go_server/zinx/ziface"
	"go_server/zinx/zlog"
)

type AbsEventData struct {
	RoleConn  ziface.IConnection
	EventType EventType
}

func (aed *AbsEventData) GetRoleConn() ziface.IConnection{
	return aed.RoleConn
}

func (aed *AbsEventData) GetEventType() EventType {
	return aed.EventType
}

func (aed *AbsEventData) GetRoleId() (int64, bool){
	conn := aed.RoleConn
	roleId, err := conn.GetProperty("roleId")
	if err != nil {
		zlog.Errorf("AbsEventData GetRoleId err!!! err: %v", err)
		return int64(0), false
	}

	return roleId.(int64), true
}